home *** CD-ROM | disk | FTP | other *** search
- Listing 2.
-
- typedef struct { int DelFrom , DelThru } DelTyp;
- #define DelsMax 20
- DelTyp Dels [ DelsMax ];
- DelTyp * DelPtr = Dels;
- DelTyp * DelMaxPtr = Dels + DelsMax;
-
- BOOL CheckDeleted
- ( ItemNo )
- int ItemNo;
-
- { if ( DelPtr < DelMaxPtr
- /* There is a deletion */
- && DelPtr -> DelFrom >= ItemNo )
- /* and it applies to ItemNo */
- { assert ( ItemNo <= DelPtr -> DelThru )
- /* We didn't slip past this deletion. */
- if ( ItemNo == DelPtr -> DelThru )
- /* ItemNo is the last covered
- by the deletion */
- DelPtr ++;
- /* Consume the deletion. */
- return TRUE;
- }
- else return FALSE;
- }
-
-